
public class Hora implements Comparable<Hora>, Cloneable{
	private int hh;
	private int mm;
	
	public Hora(){
		
	}
	
	public Hora(int hora, int minuto){
		this.hh = hora;
		this.mm = minuto;
	}
	
	public int getHh(){
		return hh;
	}
	
	public int getMm(){
		return mm;
	}
	
	public void setHh(int hora){
		this.hh = hora;
	}
	
	public void setMm(int minuto){
		this.mm = minuto;
	}
	
	@Override
	public String toString(){
		String cadena = "";
		cadena = this.hh+":"+ this.mm ;
		return cadena;
	}

	public boolean equals(Hora a){
		boolean sw = false;
		if(this.hh == a.hh && this.mm == a.mm){
			sw = true;
		}
		return sw;
	}

	@Override
	public int compareTo(Hora b) {
		// TODO Auto-generated method stub
		int r = 0; 
		if(this.hh < b.hh){
			r = -1;
		}else{
			if(this.hh> b.hh){
				r = 1;
			}else{
				if(this.hh == b.hh){
					if(this.mm < b.mm){
						r = -1;
					}else{
						if(this.mm> b.mm){
							r = 1;
							}
					}
			
				}
			}
		}
		return r;	
	}
	
	  @Override
	public Hora clone()
	    {
	        Hora clone = null;
	        try
	        {
	            clone = (Hora) super.clone();
	        } 
	        catch(CloneNotSupportedException e)
	        {
	            // NO DEBERIA OCURRIR
	        }
	        return clone;
	    }

}
